<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>监控看板 - LabEnergyInsight</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <!-- 使用本地Chart.js资源 -->
    <script src="assets/js/chart.umd.min.js"></script>
</head>
<body class="bg-gray-50">
    <!-- Header -->
    <div class="bg-white p-4 shadow-sm">
        <div class="flex justify-between items-center">
            <h1 class="text-xl font-semibold">实时监控</h1>
            <div class="flex items-center space-x-2">
                <select class="text-sm border rounded-lg px-2 py-1">
                    <option>实验室A</option>
                    <option>实验室B</option>
                    <option>实验室C</option>
                </select>
                <button class="p-2">
                    <i class="fas fa-ellipsis-v text-gray-500"></i>
                </button>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="p-4 space-y-4">
        <!-- Key Metrics Cards -->
        <div class="grid grid-cols-2 gap-4">
            <div class="bg-white rounded-xl p-4 shadow-sm">
                <div class="flex justify-between items-start">
                    <div>
                        <p class="text-sm text-gray-500">今日总能耗</p>
                        <p class="text-2xl font-bold mt-1">2,845 kWh</p>
                        <p class="text-xs text-green-500 mt-1">
                            <i class="fas fa-arrow-down"></i> 较昨日 -5.2%
                        </p>
                    </div>
                    <div class="bg-blue-50 p-2 rounded-lg">
                        <i class="fas fa-bolt text-blue-500"></i>
                    </div>
                </div>
            </div>
            
            <div class="bg-white rounded-xl p-4 shadow-sm">
                <div class="flex justify-between items-start">
                    <div>
                        <p class="text-sm text-gray-500">送风风量</p>
                        <p class="text-2xl font-bold mt-1">1,200 m³/h</p>
                        <p class="text-xs text-gray-500 mt-1">正常范围</p>
                    </div>
                    <div class="bg-green-50 p-2 rounded-lg">
                        <i class="fas fa-wind text-green-500"></i>
                    </div>
                </div>
            </div>
        </div>

        <!-- Energy Consumption Chart -->
        <div class="bg-white rounded-xl p-4 shadow-sm">
            <div class="flex justify-between items-center mb-4">
                <h2 class="font-semibold">24小时能耗趋势</h2>
                <div class="flex space-x-2">
                    <button class="text-xs px-2 py-1 bg-blue-50 text-blue-500 rounded">日</button>
                    <button class="text-xs px-2 py-1 text-gray-500 rounded">周</button>
                    <button class="text-xs px-2 py-1 text-gray-500 rounded">月</button>
                </div>
            </div>
            <canvas id="energyChart" height="200"></canvas>
        </div>

        <!-- Environment Parameters -->
        <div class="bg-white rounded-xl p-4 shadow-sm">
            <h2 class="font-semibold mb-4">环境参数</h2>
            <div class="grid grid-cols-3 gap-4">
                <div class="text-center">
                    <div class="bg-orange-50 p-3 rounded-lg inline-block">
                        <i class="fas fa-temperature-high text-orange-500"></i>
                    </div>
                    <p class="text-sm text-gray-500 mt-2">温度</p>
                    <p class="font-semibold">23.5°C</p>
                </div>
                <div class="text-center">
                    <div class="bg-blue-50 p-3 rounded-lg inline-block">
                        <i class="fas fa-tint text-blue-500"></i>
                    </div>
                    <p class="text-sm text-gray-500 mt-2">湿度</p>
                    <p class="font-semibold">45%</p>
                </div>
                <div class="text-center">
                    <div class="bg-purple-50 p-3 rounded-lg inline-block">
                        <i class="fas fa-cloud text-purple-500"></i>
                    </div>
                    <p class="text-sm text-gray-500 mt-2">CO₂</p>
                    <p class="font-semibold">450ppm</p>
                </div>
            </div>
        </div>

        <!-- Device Status -->
        <div class="bg-white rounded-xl p-4 shadow-sm">
            <div class="flex justify-between items-center mb-4">
                <h2 class="font-semibold">设备状态</h2>
                <button class="text-sm text-blue-500">查看全部</button>
            </div>
            <div class="space-y-3">
                <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                    <div class="flex items-center space-x-3">
                        <div class="bg-green-50 p-2 rounded-lg">
                            <i class="fas fa-microchip text-green-500"></i>
                        </div>
                        <div>
                            <p class="font-medium">通风系统</p>
                            <p class="text-xs text-gray-500">运行正常</p>
                        </div>
                    </div>
                    <div class="text-green-500">
                        <i class="fas fa-check-circle"></i>
                    </div>
                </div>
                <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                    <div class="flex items-center space-x-3">
                        <div class="bg-yellow-50 p-2 rounded-lg">
                            <i class="fas fa-flask text-yellow-500"></i>
                        </div>
                        <div>
                            <p class="font-medium">实验设备A</p>
                            <p class="text-xs text-yellow-500">需要维护</p>
                        </div>
                    </div>
                    <div class="text-yellow-500">
                        <i class="fas fa-exclamation-circle"></i>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Energy Consumption Chart
        const ctx = document.getElementById('energyChart').getContext('2d');
        new Chart(ctx, {
            type: 'line',
            data: {
                labels: ['00:00', '03:00', '06:00', '09:00', '12:00', '15:00', '18:00', '21:00'],
                datasets: [{
                    label: '能耗 (kWh)',
                    data: [150, 120, 100, 180, 220, 250, 200, 180],
                    borderColor: '#3B82F6',
                    backgroundColor: 'rgba(59, 130, 246, 0.1)',
                    tension: 0.4,
                    fill: true
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        display: false
                    }
                },
                scales: {
                    y: {
                        beginAtZero: true,
                        grid: {
                            display: true,
                            color: 'rgba(0, 0, 0, 0.05)'
                        }
                    },
                    x: {
                        grid: {
                            display: false
                        }
                    }
                }
            }
        });
    </script>
</body>
</html> 